@(articles:List[(Int,String,String,String,List[String],String)],pages:Int,currentPage:Int,tag:String)(implicit lang:Lang,flash:Flash,request:Request[_])

@import play.api.cache._
@import util._
@import play.api.Play.current

@main(Messages("application.name")) {
	<div class="row">
	 	<div class="col-md-9">
 		    @{
 		      articles collect { 
 		      case (id,title,time,shortcontent,tags,user) => {
 		      	Html(s"""
 		    	    <div class="blog-post">
 		    	    	<h2 class="blog-post-title"><a href="${routes.Blogs.blog(id)}">$title</a> </h2>
 		    	    	<p class="blog-post-meta"> $time by $user</p>
 		    	    	<p> $shortcontent </p>
 		    	    </div>
 		    	    <div>
 					 ${tags.map { tag =>
 			 		 s"""<a class="btn btn-lg btn-info" href="${routes.Blogs.tag(tag,1)}" style="font-size: 10px;">$tag</a>"""
 					 } mkString "&nbsp;&nbsp;"
 			 		}
 			 		</div>
 		    	    <hr/>
 		    	 """)
 		    	}
 		     }	
 		    }
 		    <center>
 		    <div class="pagination">
  				<ul>
  				@if(currentPage!=1){
   				 <li class="previous">
      			  <a href="@routes.Blogs.list(currentPage-1)" class="fui-arrow-left"></a>
    			 </li>
    			 }
                 @for( i <- 1 to pages){
                  @if(i==currentPage){
    			   <li class="active"><a href="#">@i</a></li>
    			  }else{
    			   <li><a href="@routes.Blogs.list(i)">@i</a></li>
    			  }
                 }
                 @if(currentPage!=pages){
    			 <li class="next">
      				<a href="@routes.Blogs.tag(tag,currentPage+1)" class="fui-arrow-right"></a>
    			 </li>
    			 }
  				</ul>
 		   </div>
 		   </center>
 		</div>		
		
		<div class="col-md-3">
		@right()
 		</div>

 		 
	</div>
}
